const Router = require('koa-router');
const {db, QueryTypes} = require("../../models/db");
const router = new Router();

// 查询商品库存
router.post('/zd/getSwipList', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId;

    let sql = `select top 3 id,name,spec,unit1,unit2 from v_goods where tenantId=${tenantId} order by createdAt desc `
    let list = await db.query(sql, {type: QueryTypes.SELECT})
    return ctx.suc('', {
        list
    })
})

module.exports = router;
